/*
#if PLATFORM == PLATFORM_WIN32
#	define GLEW_STATIC
#	include "glew/glew.h"
#	include "glew/wglew.h"
#endif
*/
#include "SDL/SDL.h"
//#include "SDL/SDL_image.h"
#include "textureSDL.h"

#include "kernel/debug.h"

namespace rengine3d {
	/*
	GLuint SDL_GetGLTarget(textureType_t type) {
	GLuint target = GL_TEXTURE_2D;

	switch (type) {
	case textureType_Cube:
	target = GL_TEXTURE_CUBE_MAP;
	break;
	case textureType_3D:
	target = textureType_3D;
	break;
	case textureType_2D:
	target = textureType_2D;
	break;
	case textureType_1D:
	target = textureType_1D;
	break;
	};
	return target;
	}

	CTextureSDL::CTextureSDL(): m_id(0),m_target(0) {
	}

	CTextureSDL::~CTextureSDL() {
	this->Shutdown();
	}

	void CTextureSDL::Init(void) {
	}

	void CTextureSDL::Shutdown(void) {
	glDeleteTextures(1, &m_id);
	}

	void CTextureSDL::Create( uint width, uint height, textureType_t type, textureUsage_t usage, textureFormat_t format, uint depth ) {
	m_textureInfo.format	= format;
	m_textureInfo.type		= type;
	m_textureInfo.usage		= usage;
	m_textureInfo.width		= width;
	m_textureInfo.height	= height;
	m_textureInfo.depth		= depth;

	glGenTextures(1, &m_id);
	m_target = SDL_GetGLTarget(type);
	glBindTexture(m_target, m_id);

	}

	void CTextureSDL::Create( const string_t& fileName, textureType_t type, textureUsage_t usage, textureFormat_t format) {
	m_textureInfo.format	= format;
	m_textureInfo.type		= type;
	m_textureInfo.usage		= usage;
	m_textureInfo.fileName	= fileName;

	//SDL_RWFromMem

	glGenTextures(1, &m_id);
	m_target = SDL_GetGLTarget(type);
	glBindTexture(m_target, m_id);

	}

	void CTextureSDL::Bind( uint textureUnit, bool forceSet, int flags ) {
	}

	void CTextureSDL::UnBind(void) {
	}

	void CTextureSDL::SetData( void* data, uint level ) const {
	}

	void CTextureSDL::SetDataFloat( void* data, uint size, uint level ) const {
	}

	void* CTextureSDL::GetData(uint level ) const {
	return NULL;
	}

	textureInfo_t& CTextureSDL::GetTextureInfo( void ) {
	return m_textureInfo;
	}

	uint CTextureSDL::GetBitDepth(uint level ) const {
	return 0;
	}

	void CTextureSDL::NlearRenderTarget(void) {
	}
	*/

	CTextureSDL::CTextureSDL(const string_t& name, textureType_t type, bool useMipMap, textureTarget_t target, bool compress ): ITexture(name, type, useMipMap, target, compress) {
	}

	CTextureSDL::~CTextureSDL() {
	}

	void CTextureSDL::Init(void) {
	}

	void CTextureSDL::Shutdown(void) {
	}

	bool CTextureSDL::Create(uint width, uint height, CVec4 color) {
		return true;
	}

	bool CTextureSDL::Create(unsigned char* data, int channels, const CVec3& size) {
		return true;
	}

	void CTextureSDL::Update(float timeStep) {
	}

	bool CTextureSDL::Reload(void) {
		return true;
	}

	void CTextureSDL::Unload(void) {
	}

	void CTextureSDL::Bind( uint textureUnit ) {
	}

	void CTextureSDL::UnBind(void) {
	}

	real CTextureSDL::GetGamma(void) {
		return 1.0f;
	}

	void CTextureSDL::SetGamma(real gamma) {
	}

	void CTextureSDL::SetFilter(textureFilter_t filter) {
	}

	void CTextureSDL::SetAnisotropyDegree(real value) {
	}

	void CTextureSDL::SetWrapS(textureWrap_t mode) {
	}

	void CTextureSDL::SetWrapT(textureWrap_t mode) {
	}

	void CTextureSDL::SetWrapR(textureWrap_t mode) {
	}

}